package com.hjl.spring.entity;

/**
 * @author ServivE
 * @version 0.1
 * @className Computer
 * @description
 * @date 2024/8/5 11:41
 * @since jdk11
 */

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 计算机类 组装主机和显示器 显示主机信息
 */
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Component//配置bean
public class Computer {
    @Autowired//自动装配依赖
//    @Resource
    private MainFrame mainFrame;
   @Autowired
    @Qualifier("lg")//明确指定依赖bean的名称
//    @Resource(name = "lg")
    private Display display;
    public void printComputerInfo() {
        System.out.println("主机信息配置如下");
        mainFrame.printMainFrameInfo();
        display.printDisplayInfo();
    }
}
